package com.jnshu.service;

import com.jnshu.dto.admin.*;
import com.jnshu.pojo.Manage;
import com.jnshu.tools.resultUtils.PageBean;
import com.jnshu.tools.resultUtils.ResultBean;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@FeignClient(value = "admin",url = "http://localhost:20825")
public interface AdminService {

    @GetMapping(value = "/manage/list")
    PageBean manageList(@RequestParam(name = "pageSize",defaultValue = "10")int pageSize,
                        @RequestParam(name = "pageNum",defaultValue = "1") int pageNum);

    @DeleteMapping(value = "/manage/{id}")
    ResultBean deleteManage(@PathVariable("id")long id);

    @PutMapping(value = "/manage/",produces = {"application/json;charset=UTF-8"})
    ResultBean updateManage(@RequestBody ManageVo manageVo);

    @PostMapping(value = "/manage",produces = {"application/json;charset=UTF-8"})
    ResultBean insertManage(@RequestBody ManageVo manageVo);

    @GetMapping(value = "/manage/role/{id}")
    PageBean selectManageByRole(@RequestParam(name = "pageSize",defaultValue = "10")int pageSize,
                                @RequestParam(name = "pageNum",defaultValue = "1") int pageNum,
                                @PathVariable("id")long id);
    @GetMapping(value = "/manage/{id}")
    ResultBean selectByManageId(@PathVariable("id")Long id);

    @GetMapping(value = "/role/list")
    PageBean roleList(@RequestParam(name = "pageSize",defaultValue = "10")int pageSize,
                      @RequestParam(name = "pageNum",defaultValue = "1")int pageNum);

    @DeleteMapping(value = "/role/{id}")
    ResultBean deleteRole(@PathVariable("id")long id);

    @PutMapping(value = "/role/",produces = {"application/json;charset=UTF-8"})
    ResultBean updateRole(@RequestBody RoleVo roleVo);

    @PostMapping(value = "/role",produces = {"application/json;charset=UTF-8"})
    ResultBean insertRole(@RequestBody RoleVo roleVo);

    @GetMapping(value = "/user/{id}")
    ResultBean selectRoleById(@PathVariable("id")long id);

    @GetMapping(value = "/model/list")
    PageBean modelList( @RequestParam(name = "pageSize",defaultValue = "10")int pageSize,
                        @RequestParam(name = "pageNum",defaultValue = "1")int pageNum);

    @DeleteMapping(value = "/model/{id}")
    ResultBean deleteModel(@PathVariable("id")long id);

    @PutMapping(value = "/model/",produces = {"application/json;charset=UTF-8"})
    ResultBean updateModel(@RequestBody ModelVo modelVo);

    @PostMapping(value = "/model",produces = {"application/json;charset=UTF-8"})
    ResultBean insertModel(@RequestBody ModelVo modelVo);

    @PutMapping(value = "/manage/password")
    ResultBean updateManagePassword(@RequestBody PasswordVo passwordVo);

}
